<template>
	<view>
		<view>
			<rich-text :nodes="cotent"></rich-text>
		</view>
	</view>
</template>

<script>
	import {
		gettext,
		gettext1,
		gettext2,
		gettext3,
		getKefu
	} from '../../common/path.js'
	export default {
		data() {
			return {
				cotent: ''
			}
		},
		onLoad(option) {
			if (option.id == 1) {
				this.gettext3() //用户协议
			} else if (option.id == 2) {
				this.gettext2() //隐私协议
			} else if (option.id == 3) {
				this.gettext() //关于我们
			}else if (option.id == 4){
				this.getKefu()
			}

			

			// this.gettext1() //注册协议

			uni.setNavigationBarTitle({
				title: option.title + ''
			})
		},
		onShow() {

		},
		methods: {
			//注册协议
			gettext1() {
				this.$axios.axios('POST', gettext1, {})
					.then(res => {
						console.log('注册协议', res.data.content);
						this.cotent = res.data.content
					})
					.catch(err => {
						console.log(err);
					})
			},
			//隐私协议
			gettext2() {
				this.$axios.axios('POST', gettext2, {})
					.then(res => {
						console.log('隐私协议', res.data.content);
						this.cotent = res.data.content
					})
					.catch(err => {
						console.log(err);
					})
			},
			//用户协议
			gettext3() {
				this.$axios.axios('POST', gettext3, {})
					.then(res => {
						console.log('用户协议', res.data.content);
						this.cotent = res.data.content
					})
					.catch(err => {
						console.log(err);
					})
			},
			//关于我们
			gettext() {
				this.$axios.axios('POST', gettext, {})
					.then(res => {
						console.log('关于我们', res.data.content);
						this.cotent = res.data.content
					})
					.catch(err => {
						console.log(err);
					})
			},
			//客服
			getKefu() {
				this.$axios.axios('POST', getKefu, {})
					.then(res => {
						console.log('客服', res.data.content);
						this.cotent = res.data.content
					})
					.catch(err => {
						console.log(err);
					})
			}
		}
	}
</script>

<style>
</style>
